package com.ruoyi.controller;


import com.ruoyi.service.Base64Service;
import com.ruoyi.utils.SimpleResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.*;
import java.util.Base64;
import java.util.Objects;

@RestController
@RequestMapping("/base64")
public class Base64Controller {
    @Autowired
    private Base64Service base64Service;

    @PostMapping("/file-to-base64")
    public SimpleResult fileToBase64(@RequestBody MultipartFile file) {
        return base64Service.fileToBase64(file);
    }

    @GetMapping("/get-base64-list")
    public SimpleResult getBase64List() {
        return base64Service.getBase64List();
    }

}
